package com.dashboard.event;

import com.dashboard.entity.WarningJob;
import com.dashboard.event.entity.HotListSpringEventEntity;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author xuxiao
 */
@Component
public class HotListEventListener {

//    @Resource
//    注入

    @EventListener
    public void onHotListEvent(HotListSpringEventEntity hotListSpringEvent){
        Object source = hotListSpringEvent.getSource();
        List<WarningJob> list = (List<WarningJob>) source;
        System.out.println(Thread.currentThread().getName()+"数量："+list.size());
    }

}
